<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/jquery-1.8.3.min.js"></script>
    <script>
        function zan(id){
            $.ajax({
                url:"/addZan",
                type:"get",
                data:"id="+id,
                success:function (data){
                    $('#countZan').text(data);
                }
            })
        }
    </script>
</head>
<body>
<h1 style="text-align: center">新闻1</h1>
阅读数 <font color="red" th:text="${read}"></font>&nbsp;&nbsp;
点赞数 <font id="countZan" color="red" th:text="${zan==null?0:zan}"></font>&nbsp;&nbsp;
<input type="button" onclick="zan(2)" value="点赞"/>
</body>
</html>

</body>
</html>